package chabernac.android.wordbattle.paint.bogglemerge;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Picture;
import android.graphics.RectF;
import android.view.View;
import chabernac.android.wordbattle.R;
import chabernac.android.wordbattle.WordRasterContext;
import chabernac.android.wordbattle.paint.iDrawable;

import com.larvalabs.svgandroid.SVG;
import com.larvalabs.svgandroid.SVGParser;

public class BoggleMergeBackGroundDrawable extends iDrawable {
  private Picture myBackGround;
  private final Paint myPaint = new Paint();
  
  public BoggleMergeBackGroundDrawable(){
    init();
  }
  
  private void init(){
    SVG svg = SVGParser.getSVGFromResource(WordRasterContext.getInstance().getContext().getResources(), R.raw.rasterbackground);
    myBackGround = svg.getPicture();
    
    myPaint.setAntiAlias( true );
  }

  @Override
  public void paint(Canvas aCanvas, View aView) {
    //draw the background
    RectF theRect = new RectF(0,0,aCanvas.getWidth(), aCanvas.getHeight());
    aCanvas.drawPicture( myBackGround, theRect);
  }

}
